package com.cn.quartz;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.log4j.Logger;
import org.xml.sax.SAXException;

import com.meterware.httpunit.GetMethodWebRequest;
import com.meterware.httpunit.WebConversation;
import com.meterware.httpunit.WebRequest;
import com.meterware.httpunit.WebResponse;

/**
 * 用以测试quartz的bean
 * 
 * @author linp
 * 
 */
public class QuartzSample {
	/**
	 * 打印日志
	 */
	public static Logger logger = Logger.getLogger(QuartzSample.class);

	public void diaplayCurrentTime() throws IOException, SAXException {
		Date current = new Date();
		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss E");
		logger.debug("CurrentTime is " + format.format(current));
		WebConversation conversation = new WebConversation();
		WebRequest request = new GetMethodWebRequest(
				"http://localhost:8080/j2ee_min/kl8Action.action?number=1,2,3,4,5&times=2");
		WebResponse response = conversation.getResponse(request);
		logger.debug(response.getText());

	}
}
